<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>MYU</title>
<link rel="stylesheet" href="../js/kindeditor/plugins/code/prettify.css" />
<script charset="utf-8" src="../js/kindeditor/plugins/code/prettify.js"></script>
<script type="text/javascript" src="../js/kindeditor/kindeditor-min.js" ></script>
<script type="text/javascript" src="../js/kindeditor/zh_CN.js" ></script>
<script src="../js/formValidator/jquery-1.4.4.min.js" type="text/javascript"></script>
<script src="../js/formValidator/formValidator-4.1.0.js" type="text/javascript" charset="UTF-8"></script>
<script src="../js/formValidator/formValidatorRegex.js" type="text/javascript" charset="UTF-8"></script>
<script language="javascript" src="../js/formValidator/DateTimeMask.js" type="text/javascript"></script>

<script>
	var editor;
	KindEditor.ready(function(K) {
		editor = K.create('textarea[name="content"]', {
			cssPath : '../js/kindeditor/plugins/code/prettify.css',
			allowFileManager : true,
			width : '680px',
			height : '200px',
			uploadJson : '../kindeditor/upload',
			fileManagerJson : '../kindeditor/manager',
			allowFileManager : true
		});
		prettyPrint();
	});
	
	
	$(document).ready(function(){
		$.formValidator.initConfig({formID:"form1",theme:"ArrowSolidBox",debug:false,submitOnce:true,
			onError:function(msg,obj,errorlist){
				$("#errorlist").empty();
				$.map(errorlist,function(msg){
					$("#errorlist").append("<li>" + msg + "</li>")
				});
				alert(msg);
			},
			submitAfterAjaxPrompt : '有数据正在异步验证，请稍等...',
			onShowClass : "",
			onFocusClass : "",
			onCorrectClass : ""
		});
		
		$("#title").formValidator({onShowText:"请输入文章标题",onFocus:"内容至少1个字符,最多100个字符"}).inputValidator({min:1,max:100,onError:"请输入正确的文章标题"});
		$("#content").formValidator({onShow:"请输入文章内容",onFocus:"内容10个字符,最多1000个字符"}).inputValidator({min:10,max:1000,onError:"请输入正确的文章内容"});
	});
</script>
</head>
<body>
<%@include file="/top.jsp" %>

	<form id="form1" name="form1" action="../article/create!save" method="post">
	<table style="margin: 0 auto;">
		<tr>
			<td><font style="color: #333;">发布文章</font><br /><br /> </td>
		</tr>
		<tr>
			<td><input id="title" style="width: 670px" type="text" name="title" /></td>
			
		</tr>
		<tr>
			<td><div id="titleTip" style="width:100%"></div></td>
		</tr>
		<tr>
			<td><textarea id="content" name="content" ></textarea></td>
		</tr>
		<tr>
			<td><div id="contentTip" style="width:100%"></div></td>
		</tr>
		<tr>
			<td style="text-align: right;"><input type="submit" value="提交" /></td>
		</tr>
	</table>
	</form>

</body>
</html>